﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>layDate Demo</title>
<script src="laydate/laydate.js"></script>
<style>
html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:'微软雅黑'}
h2{line-height:30px; font-size:20px;}
a,a:hover{ text-decoration:none;}
pre{font-family:'微软雅黑'}
.box{width:970px; padding:10px 20px; background-color:#fff; margin:10px auto;}
.box a{padding-right:20px;}
</style>
</head>
<body>
开始日：<li class="laydate-icon" id="start" style="width:200px; margin-right:10px;"></li>
结束日：<li class="laydate-icon" id="end" style="width:200px;"></li>
<script>
// 颜色样式
// laydate.skin('molv')
// laydate.skin('default')
// laydate.skin('dahong')
laydate.skin('huanglv')
// laydate.skin('qianhuang')
// laydate.skin('yalan')
var arr = ['yalan','molv','default','dahong','huanglv','qianhuang']
laydate.skin(arr[~~(Math.random()*arr.length)])
var start = {
  defSkin: 'dahong',
  elem: '#start',
  format: 'YYYY/MM/DD hh:mm:ss',
  min: laydate.now(), //设定最小日期为当前日期
  max: '2099-06-16 23:59:59', //最大日期
  istime: true,
  istoday: false,
  choose: function(datas){
     end.min = datas; //开始日选好后，重置结束日的最小日期
     end.start = datas //将结束日的初始值设定为开始日
  }
};
var end = {
  elem: '#end',
  format: 'YYYY/MM/DD hh:mm:ss',
  min: laydate.now(),
  max: '2099-06-16 23:59:59',
  istime: true,
  istoday: false,
  choose: function(datas){
    start.max = datas; //结束日选好后，重置开始日的最大日期
  }
};
laydate(start);
laydate(end);
</script>
</body>
</html>